from django.http import HttpResponse
from django.views import View

def demo(request):
    if request.method == 'GET':
        return HttpResponse("成功1——函数视图 —— GET")
    elif request.method == 'POST':
        return HttpResponse("成功1——函数视图 —— POST")



class DemoStu(View):
    def get(self,request):
        return HttpResponse("成功2——类视图——GET")
    def post(self,request):
        return HttpResponse("成功2——类视图——POST")

